
/*--------------------------------------------------------------------------
  
  In the default Extras screen, such as the Characters screen, you won't be able to see the data unless the global switch is on.
  Instead, you'll see ??? as the name of the data.
  But the fact that the user can see the number of ??? also means they can determine how much data there is in the game.
  This plugin doesn't add data to the list unless the global switch is on.
  This means that the user won't see the ???, so they can't determine how much data there is.
  
  Keep in mind that if you turn on the global switch, it will be recorded in the environment.evs file.
  Even if you turn off the global switch in your game, the data will still be added to the list.
  
  Usage:
  Describe
  
  {switchId: 0}
  
  etc. at a custom parameter of the Story Settings data.
  
  Author:
  SapphireSoft
  https://srpgstudio.com/
  
  History:
  2024/10/08 Released
  
--------------------------------------------------------------------------*/

(function() {
	
ExtraListControl._isDataEnabled = function(data) {
	var switchId;
	var inclusiveSwitchId = this._getInclusiveSwitchId();
	
	if (inclusiveSwitchId === -1) {
		if (typeof data.custom.switchId !== 'number') {
			return true;
		}
		
		switchId = data.custom.switchId;
	}
	else {
		switchId = inclusiveSwitchId;
	}
	
	return root.getExternalData().isGlobalSwitchRegistered(switchId);
};

ExtraListControl._getInclusiveSwitchId = function() {
	// Perhaps your game is divided into a first part and a second part.
	// Such a switch might be named something like "Start Part II".
	// If such a switch exists, it is useful to return the switch ID in this method.
	// This will cause data to be added to the list all at once after the start of the second part.
	// In other words, there is no need to set custom parameters for the data in the second part.
	return -1;
};

})();
